package com.eboss2.sbs.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.RelativeLayout;

import com.eboss2.sbs.R;
import com.eboss2.sbs.activity.base.BaseActivity;
import com.mytools.tool.activityManager.MyActivityManager;
import com.tool.utils.utils.ToastUtils;
import com.tool.utils.view.ToggleButton;

public class MyAppFunctionActivity extends BaseActivity implements View.OnClickListener{


	private ToggleButton itemsCheck1;
	private RelativeLayout rl_sm_no;
	private RelativeLayout rl_desk_no;



	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		mContext = this;
		setContentView(R.layout.activity_my_app_function);
		MyActivityManager.getInstance().addActivity(this);
		initView();
	}
	
	private void initView(){
		showView(R.id.titleback_btn_back, true);
		setTvText(R.id.tv_title, "App收款功能");
		showView(R.id.next_sure, false);
		findViewById(R.id.titleback_btn_back).setOnClickListener(this);

		itemsCheck1 = findViewById(R.id.mSliderBtn1);
		itemsCheck1.setOpen(true);
		itemsCheck1.setOnToggleListener(new ToggleButton.OnToggleListener() {
			@Override
			public void onToggle(boolean isOpen) {

//				toast(isOpen ? "开关" : "关闭");
				ToastUtils.showShort(mContext, isOpen ? "开关" : "关闭");
			}
		});

		relativeLayout(R.id.rl_sm_no).setOnClickListener(this);
		relativeLayout(R.id.rl_desk_no).setOnClickListener(this);


	}





	
	@Override
	public void onClick(View v) {
		switch (v.getId()) {
			case R.id.titleback_btn_back:
				finish();
				break;
			case R.id.rl_sm_no:
				startActivity(new Intent(mContext, ActivityAppReceiverFunction.class).putExtra("type", 1));
				break;
			case R.id.rl_desk_no:
				startActivity(new Intent(mContext, ActivityAppReceiverFunction.class).putExtra("type", 2));
				break;
			default:break;
		}
	}

	
}
